// pdf export
@import 'layout_variables';
@import '_variables';

@page{
    margin: 1cm;
}

html {
    background-color: transparent;
    border: 0 none;
    color: $print_text;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
    display: block;
    font-family: 'OpenSans', sans-serif;
    font-size: 10px;
    font-size: $print_fontsize;
    font-weight: normal;
    height: auto;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    position: relative;
    white-space: normal;
    width: auto;
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    pre,
    hr {
        margin: 1em 0;
    }
    sup{
        font-size: .625em;
    }
}
*,
*::before,
*::after {
	-webkit-box-sizing: inherit;
	-moz-box-sizing: inherit;
	box-sizing: inherit;
}

// filigranne
img.wtmk {
	height: auto;
	opacity: .33;
	pointer-events: none;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 2;
}

header.task_header{
 	height: 7.5cm;
 	z-index: 5;
 	.full_banner {
		display: block;
		height: auto;
		margin: 0 auto 0 0;
		max-height: 3.7cm;
		max-width: 18.5cm;
 	}
    .pdf_logo {
        border: 0 none;
        width: 10cm;
        td {
            border: 0 none;
            text-align: left;
            vertical-align: top;
        }
        .logo_cell {
            overflow: hidden;
            width: 3.25cm;
        }
		.logo_img {
			display: block;
			height: auto;
			max-width: 3cm;
		}
		.company_cell {
			width: 6.75cm;
		}
		h4 {
			margin-top: 0;
		}
    }
    .pdf_address_block {
        display: block;
        height: 4cm;
        left: 9.5cm;
        position: absolute;
        top: 4cm;
        width: 9cm;
        div {
        	height: 4cm;
	        padding: .5cm;
        	position: relative;
        	width: 9cm;
        	.corner {
		    	border: 0 dotted $print_lightGrey;
        		display: block;
        		height: .4cm;
        		position: absolute;
        		width: .4cm;
        		&.bottom {
        			border-bottom-width: 1px;
        			bottom: 0;
        		}
        		&.left {
        			border-left-width: 1px;
        			left: 0;
        		}
        		&.right {
        			border-right-width: 1px;
        			right: 0;
        		}
        		&.top {
        			border-top-width: 1px;
        			top: 0;
        		}
        	}
        }
    }
}
main{
    display: block;
    position: relative;
}

.information_intro {
	font-size: $print_fontsize_table;
	width: 9.5cm;
}
.pdf_information {
	display: block;
	font-size: $print_fontsize_table;
   	width: 18.5cm;
	h1 {
		font-size: $print_fontsize_large;
		margin: 0;
		padding: var(--print-padding-r) 0 0;
	}
	.workplace {
		line-height: 1.25;
		padding: .1cm 0;
	}
	.coop_header {
		border: 1pt solid $print_fadedGrey;
		margin: var(--print-padding-r) 0;
		padding: var(--print-padding-m);
	}
	.info_cols {
		align-items: flex-end;
		display: flex;
		justify-content: space-between;
		padding-bottom: .5cm;
		.customer_info {
			flex: 0 0 9cm;
			margin-left: var(--print-padding-m);
			padding-top: .25cm;
		}
	}
}
.pdf_spacer {
	font-size: 2pt;
}
table {
	border-collapse: collapse;
	border: 1pt solid $print_border;
	border-width: 1pt 0;
	table-layout: fixed;
	width: 18.5cm;
	tr:nth-child(2n+1) {
		background: none !important;
	}
	+ table {
		border-top-width: 0;
	}
	&.payment_schedule {
		border-color: $print_border;
		border-width: 1pt 0;
		table-layout: auto;
		th,
		td {
			border-color: $print_border;
		}
		.col_date {
			width: 1.625cm;
		}
		.col_number {
			width: 1.75cm;
		}
	}
}
.pdf_task_table table {
	border-width: 0;
	&:first-child {
		border-top-width: 1pt;
	}
	&:last-child {
		border-bottom-width: 1pt;
	}
	.group_description {
		.col_text {
			padding-bottom: var(--print-padding-l);
		}
		h2 {
			font-size: $print_fontsize_mid;
			margin: 0;
			padding: 0;
		}
		td {
			border-top-width: 1pt;
		}
		p {
			margin: 0;
			padding: 0;
		}
	}
	.work_item td {
		border-top-style: dashed;
		&:first-child {
			padding-left: var(--print-padding-l);
		}
	}
	.table_head th,
	.table_head td {
		color: $print_darkGrey;
	}
}
th,
td {
	background: $print_transWhite;
	border: .5pt solid $print_border;
	border-width: .5pt 0 0;
	font-size: $print_fontsize_table;
	padding: var(--print-padding-r);
	vertical-align: top;
}
th[scope="col"] {
	border-top-width: 0;
	line-height: 1;
}
tbody tr:first-child th.progress_invoicing {
	text-align: center;
}
tbody tr:not(:first-child) th.progress_invoicing {
	border-top-width: 0;
}
th {
	vertical-align: bottom;
}
td.empty {
	padding: 0;
}
td.archive {
	color: $print_darkGrey;
	font-style: italic;
}
.long_description td {
	border-width: 0;
	padding: 0 var(--print-padding-r) var(--print-padding-r);
}
.col_text {
	hyphens: auto;
	text-align: left;
	&.description {
		overflow-wrap: break-word; /* valeur bizarre mais c’est pour weasyprint */
		h1,
		h2,
		h3,
		h4,
		h5,
		h6 {
			font-weight: bold;
			margin: 0;
			padding: var(--print-padding-r) 0 0;
		}
		h1 {
			font-size: $print_fontsize_large;
			line-height: $print_fontsize;
		}
		h2 {
			font-size: $print_fontsize_mid;
			line-height: $print_fontsize;
		}
		h3,
		h4,
		h5,
		h6 {
			font-size: $print_fontsize;
		}
	}
	&.rich_text ul {
		list-style-type: square;
		margin: 0 0 var(--print-padding-m) var(--print-padding-l);
		padding: 0;
		li {
			padding: var(--print-padding-s) 0;
			&:last-child {
				padding-bottom: 0;
			}
		}
		ul {
			margin-left: var(--print-padding-xl);
		}
		&:last-child {
			margin-bottom: 0;
		}
	}
	&.unity {
		width: 1.75cm;
	}
	&.align_right {
		text-align: right;
	}
}
.col_number {
	text-align: right;
}
tr.work_description {
	h3.work_title {
		padding: 0;
		+ * {
			padding-top: var(--print-padding-m);
		}
	}
	.col_number,
	.col_text.unity {
		font-weight: bold;
	}
}
.col_date {
	width: 3cm;
}
.price,
.price_total {
	width: 2cm;
}
tr.row_total {
	th,
	td {
		font-weight: bold;
	}
}
.progress_invoicing,
th.progress_invoicing {
	text-align: center;
	width: 1.25cm;
}
.deposit {
	width: 1.75cm;
}
.price_total {
	background: $print_veryFadedGreyTrans;
}
.quantity {
	width: 1cm;
}
.tva {
	width: 1.25cm;
}
.screen-reader-text {
	display: none;
}
.notes_group {
	display: flex;
	flex-wrap: wrap;
	justify-content: stretch;
	> div {
		flex: 1 1 50%;
		&.options {
			display: flex;
			flex-direction: column;
			justify-content: center;
		}
		+ div:nth-child(2n) {
			margin-left: var(--print-padding-m);
		}
	}
}
.payment_conditions {
	> div {
		align-items: flex-start;
		display: flex;
		justify-content: space-between;
		padding: var(--print-padding-m);
		p,
		> div {
			flex: 0 0 50%;
		}
		p {
			padding: 0 var(--print-padding-m) 0 0;
		}
		> div {
			padding-left: var(--print-padding-m);
		}
	}
	table {
		max-width: 100%;
		width: 8.875cm;
		th {
			text-align: left;
		}
	}
}
.estimation_last_mention {
	align-items: flex-start;
	display: flex;
	justify-content: space-between;
	.pdf_mention_block {
		flex: 0 0 12cm;
	}
	.pdf_sign_block {
		flex: 0 0 6cm;
	}
}
.pdf_mention_block {
	background: $print_transWhite;
	border: 1pt solid $print_fadedGrey;
    break-inside: avoid;
	margin: var(--print-padding-l) 0 0;
	h4 {
		background: $print_fadedGrey;
		margin: 0;
		padding: 0 var(--print-padding-m);
	}
	p {
		font-size: $print_fontsize_table;
		line-height: 1.25;
		margin: 0;
		padding: var(--print-padding-r) var(--print-padding-m);
	}
}
.document_help {
	font-size: $print_fontsize_small;
}
.pdf_sign_block {
	background: $print_transWhite;
	border: 1pt solid $print_fadedGrey;
	margin: var(--print-padding-l) 0 0 0;
    break-inside: avoid;
	.pdf_sign_block_width {
		h4 {
			background: $print_fadedGrey;
			margin: 0;
			padding: 0 var(--print-padding-m);
		}
		p {
			margin: 0;
			padding: var(--print-padding-m) var(--print-padding-m) var(--print-padding-r);

			&.reference {
				padding: var(--print-padding-r) var(--print-padding-m) 0;
			}
		}
		.signature {
			padding-bottom: 1cm;
		}
	}
}

footer{
    bottom: .5cm;
    display: block;
    left: 0;
    line-height: 1.25;
    position: fixed;
    text-align: center;
    width: 100%;
}

.pdf_footer {
    display: block;
	font-size: $print_fontsize_small;
	margin: 0;
	padding: .2cm 0 0;
	text-align: center;
	p {
		background: $print_veryFadedGrey;
		margin: 0;
		padding: .1cm 1cm;
	}
}
.pdf_page_number{
	display: block;
	font-size: $print_fontsize_table;
	margin: 0;
	p {
		margin: 0;
		padding: .1cm 0 0;
		text-align: center;
	}
	.page_count span {
		display: inline-block;
		padding: 0 1em;
	}
}

.cgv-container{
    bookmark-level: 1;
    bookmark-label: "CGV";
    break-before: always;
    .pdf_cgv {
    	line-height: 1.25;
        font-size: $print_fontsize_small;
        padding: 0;
        text-align: justify;
        + .pdf_cgv {
	        margin-top: 1cm;
        }
    }
    h1, h2, h3, h4, h5{
	    margin: .1cm;
    }
}

/* Atelier et Rendez-vous */
.workshop_view, .activity_view {
	table {
		table-layout: fixed;
	}
	td.col_text.description {
		vertical-align: middle;
	}
	th.slot_signature {
        border-left: .5pt dashed $print_border;
        text-align: center;
	}
	td.slot_signature {
        border-left: .5pt dashed $print_border;
		height: 1.5cm;
		width: 3cm;
	}
    header{
        position: relative;
        img{
            max-width: 100%;
        }
    }
	.pdf_title_block {
		text-align: center;
		h1 {
		}
		h2 {
			margin: 0;
			padding: 0;
		}
		p {
			margin: 0;
			padding: 0;
		}
	}
}
.activity-view{
    .activity-title{
        border-bottom: .5pt solid $print_border;
        font-weight: 500;
        margin: .2cm 0 .1cm;
        padding: 0;
    }
    .activity-content{
        padding-left: .5cm;
    }
	.activity_people {
		font-size: 9pt;
	}
}
/* !!! Le footer est en dehors du html du contenu <html></html><footer></footer> !!!*/
footer.activity_footer, footer.workshop_footer{
    text-align: left;
    img{
        max-width: 100%;
        height: 2cm;
        width: auto;
    }
}
.upper{
	text-transform: uppercase;
}
.description ul{
	margin-bottom: 3px;
}
.description li, .description p, .description div{
	margin: 0;
	padding: 0;
	font-size: $print_fontsize_table;
	line-height: 1.25;
	vertical-align: middle;
}
.description p{
	margin: 2px 0px;
}

/* Attestation SAP */
.sap_group {
	border-bottom-width: 0;
}
.sap_month {
	width: 4cm;
	border-bottom-width: 0;
}
.sap_label {
	width: 6cm;
}

.sap_bottom_mention, .sap_bottom_signature {
	width: 50%;
}

.sap_bottom_signature {
	text-align: right;
	img {
		max-width: 6cm;
		max-height: 6cm;
	}
}

